package com.yjw.yunmusic.web.control;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class SongControl {

    @RequestMapping(path = "/song")
    //required = false,如果传入空值会报错
    public String getSong(@RequestParam(name="id",required = false) String songId){
        //判断songID信息
        if(songId == null){
            songId="1";
        }
        if(songId.equals("1")){
            return "1.html";
        }else{
            return "other.html";
        }
    }

}
